package org.jivesoftware.smack.filter;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.jivesoftware.smack.packet.Packet;

public class AndFilter
  implements PacketFilter
{
  private List<PacketFilter> filters = new ArrayList();

  public AndFilter()
  {
  }

  public AndFilter(PacketFilter[] paramArrayOfPacketFilter)
  {
    if (paramArrayOfPacketFilter == null)
      throw new IllegalArgumentException("Parameter cannot be null.");
    for (PacketFilter localPacketFilter : paramArrayOfPacketFilter)
    {
      if (localPacketFilter == null)
        throw new IllegalArgumentException("Parameter cannot be null.");
      this.filters.add(localPacketFilter);
    }
  }

  public void addFilter(PacketFilter paramPacketFilter)
  {
    if (paramPacketFilter == null)
      throw new IllegalArgumentException("Parameter cannot be null.");
    this.filters.add(paramPacketFilter);
  }

  public boolean accept(Packet paramPacket)
  {
    Iterator localIterator = this.filters.iterator();
    while (localIterator.hasNext())
    {
      PacketFilter localPacketFilter = (PacketFilter)localIterator.next();
      if (!localPacketFilter.accept(paramPacket))
        return false;
    }
    return true;
  }

  public String toString()
  {
    return this.filters.toString();
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.jivesoftware.smack.filter.AndFilter
 * JD-Core Version:    0.6.1
 */